#include "Main.h"

VOID __declspec(naked) __fastcall PrintText_ASM(CHAR* szText, DWORD dwGlobalClass)
{
	static DWORD dwBuffer = 0xFFFFFFFF;
	__asm 
	{
		
		PUSH NULL
		PUSH 0x41200000
		LEA EAX, dwBuffer
		PUSH EAX	
		PUSH ECX
		MOV ECX,DWORD PTR DS:[EDX+0x3EC]
		CALL GAME_Print
		RETN
	}
}

VOID PrintText(CHAR* szFormat, ...)
{
	if(!GAME_GetPtrList())
		return;

	CHAR szString[8192] = {NULL};
	va_list vaArgs;

	va_start(vaArgs, szFormat);
	vsprintf(szString,  szFormat, vaArgs);
	va_end(vaArgs);

	PrintText_ASM(szString, GAME_GetPtrList());
}